import request from '@/utils/request'
var group_name = 'role'
export default {
  getRoleList(page) { 
    return request({
      url: `/${group_name}/roleList`,
      method: 'post',
      data:page
    })
  },
  getAllRole() { 
    return request({
      url: `/${group_name}/getAllRole`,
      method: 'get'
    })
  },
  addRole(role) { 
    return request({
      url: `/${group_name}/addRole`,
      method: 'post',
      data: role
    })
  },
  deleteRole(id) { 
    return request({
      url: `/${group_name}/deleteRole/${id}`,
      method: 'delete'
    })
  },
  viewRole(id) { 
    return request({
      url: `/${group_name}/viewRole/${id}`,
      method: 'get'
    })
  },
  update(role) { 
    return request({
      url: `/${group_name}/update`,
      method: 'put',
      data: role
    })
  },
  getMenuByRoleIds(id) { 
    return request({
      url: `/${group_name}/getMenuByRoleIds/${id}`,
      method: 'get'
    })
  },
  addMenus(idList,id) {
    return request({
      url: `/${group_name}/addMenus/${id}`,
      method: 'post',
      data: idList
    })
  }

}